package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.dto.SetmealDTO;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import com.sky.vo.SetmealVO;
import com.sky.vo.ShoppingParamVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {


     Page<SetmealVO> findPage(SetmealPageQueryDTO setmealPageQueryDTO);

    /**
     * 根据分类id查询套餐的数量
     * @param id
     * @return
     */
   // @Select("select count(id) from setmeal where category_id = #{categoryId}")
    Integer countByCategoryId(Long id);

    /**
     * 根据id修改套餐
     *
     * @param setmeal
     */
    @AutoFill(OperationType.UPDATE)
    Integer update(Setmeal setmeal);
    List<Setmeal> dishIsInSetmeal(Integer id);
   // @AutoFill(value = OperationType.UPDATE)
    Integer changeStatus(Integer status, Long id);

    Integer delete(List<Long> ids);

    SetmealVO findById(Long id);

    List<Setmeal> find(List<Long> ids);
    @AutoFill(value = OperationType.INSERT)
    Integer insert(Setmeal setmeal);

    List<SetmealVO> findByCategoryId(Long categoryId);

    ShoppingParamVO findShoppingById(Long setmealId);


    Integer selectSetmealsByStatus(int i);



    // Integer update(SetmealDTO setmeal);

}
